package com.yanu.trace.t2s.service.impl;

import com.yanu.trace.t2s.entity.Emp;
import com.yanu.trace.t2s.mapper.EmpMapper;
import com.yanu.trace.t2s.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmpServiceImpl implements EmpService {

    @Autowired
    EmpMapper empMapper;


    @Override
    public List<Emp> findAll() {
        return empMapper.findAll();
    }

    @Override
    public Emp findByEmpno(int empno) {
         return  empMapper.findByEmpno(empno);
    }

    @Override
    public int addEmp(Emp emp) {
        empMapper.addEmp(emp);
        return   1;
    }

    @Override
    public List<Emp> findAllwithDept() {
        return empMapper.findAllwithDept();
    }

    public List<Emp> findAllMany2One(){
        return  empMapper.findAllMany2One();
    }


}
